<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <base href="<%=basePath%>">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0"> 
 	<%@ include file="/common/importJsCss.jsp" %>
 	<script type="text/javascript" id="preJavascript">
$(function(){
	//1.正则表达式两种方式
    //var reCat = new RegExp("cat");
	var data = "123123";
    var reCat = /123/gi;
    out("reCat.test(data)",reCat.test(data));  //true
    //2.匹配数字,字母串
    var wErrorData = "123abc,,,,";
    var wSuccessData = "123abc";
    var reW = new RegExp("^\\w+$");
    out("reW.test(wErrorData)",reW.test(wErrorData));  //false
    out("reW.test(wSuccessData)",reW.test(wSuccessData));  //true
});
	</script>
  </head>  
  <body>
	<div class="container">
        <div class="page-header">
            <h2>正则表达式</h2>
        </div>
<pre class="prettyprint linenums"></pre>
    </div>
  </body>
</html>
